package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Brand;
import com.java.manage.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 车辆品牌
 */
@RestController
@RequestMapping("/brand")
public class BrandController {
    @Autowired
    private BrandService brandService;

    @PostMapping("/list")
    public Result list(@RequestBody Brand brand) {
        return brandService.list(brand);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Brand brand) {
        return brandService.save(brand);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Brand brand) {
        return brandService.modify(brand);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return brandService.remove(ids);
    }

    /**
     * 查询类型
     * @return
     */
    @PostMapping("/brandList")
    public Result brandList() {
        return brandService.brandList();
    }
}
